<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>物料管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/materiel/materList">物料管理列表</a></li>
		<shiro:hasPermission name="sys:materiel:edit"><li><a href="${ctx}/sys/materiel/form">物料管理添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="materiel" action="${ctx}/sys/materiel/searchMaterList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>配件编号：</label>
				<form:input path="partsCode" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>物料编号：</label>
				<form:input path="code" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>物料名称</label>
				<form:input path="cnName" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>物料来源</label>
				<form:input path="userName" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>厂家编号：</label>
				<form:input path="venderCode" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>制造商品牌：</label><form:select id="venderId" path="venderId" class="input-medium">
			<form:option value="" label="选择品牌"/>
			<form:options items="${vender}" htmlEscape="false" itemValue="id" itemLabel="name"/>
			</form:select>
			</li>
			<li><label>状态：</label><form:select id="auditingStatus" path="auditingStatus" class="input-medium">
			    <form:option value="" label="请选择状态"/>
			    <form:options items="${fns:getDictList('auditing_status')}" htmlEscape="false" itemValue="value" itemLabel="label"/>
			    </form:select>
			</li> 
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<div style="display:none;">
		<sys:message content="${message}"/>
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>物料编号</th>
				<th>物料名称</th>
				<th>配件编号</th>
				<th>所属类目</th>
				<th>原ERP内码</th>
				<th>制造商品牌</th>
				<th>厂家编号</th>
				<th>物料来源</th>
				<th>状态</th>
				<shiro:hasPermission name="sys:materiel:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="materiel" varStatus="status">
			<tr>
				<td>
					${status.index+1}
				</td>
				<td>
					<a href="${ctx }/sys/materiel/viewMateriel?useId=${materiel.id}">${materiel.code}</a>
				</td>
				<td>
					${materiel.cnName}
				</td>
				<td>
					${materiel.partsCode}
				</td>
				<td>
					${materiel.name1},${materiel.name2},${materiel.name3}
				</td>
				
				<td>
					${materiel.erp}
				</td>
				
				<td>
					${materiel.vName}
				</td>
				<td>
					${materiel.venderCode}
				</td>
				
				<td>
					${materiel.userName}
				</td>
				
				<td>
					${fns:getDictLabel(materiel.auditingStatus, 'auditing_status', '')}<br>
					<span style="color:red">${materiel.auditingRemark }</span>
				</td>
				
				
				<shiro:hasPermission name="sys:materiel:edit"><td>
				    <c:if test="${materiel.auditingStatus!=0}">
    				<a href="${ctx }/sys/materiel/viewForm?useId=${materiel.id}">编辑</a>
					<a href="${ctx}/sys/materiel/delete?id=${materiel.id}" onclick="return confirmx('确认要删除该物料吗？', this.href)">删除</a>
					</c:if>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>